package com.cheng.im.gateway;

import com.cheng.im.gateway.server.TCPServer;
import com.cheng.im.gateway.session.manager.SessionManger;
import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScans;

/**
 * @author Cheng
 */
@SpringBootApplication
@EnableDubbo
public class IMGateWayApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(IMGateWayApplication.class, args);
        /**
         * 将SessionManger 单例设置为spring bean
         */
        SessionManger sessionManger = context.getBean(SessionManger.class);
        SessionManger.setSingleInstance(sessionManger);
    }
}
